module MemByteSelect(icode, counter, address, ub, lb);
input [3:0] icode;
input [1:0] counter;
input [31:0] address;

output reg ub;
output reg lb;

wire is_align;

assign is_align = !address[0];

always @(*) begin
	if(is_align) begin
		ub <= 1;
		lb <= 1;
	end else begin
		if(counter == 0) begin
			ub <= 1;
			lb <= 0;
		end else if(counter == 1) begin
			ub <= 1;
			lb <= 1;
		end else if(counter == 2) begin
			ub <= 0;
			lb <= 1;
		end else begin
			ub <= 0;
			lb <= 0;
		end
	end
end

endmodule